package com.itheima.功能流.序列化流;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
//反序列化流的停止标志为EOFException异常
public class 对象反序列化流 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //创建对象输入流
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("user.txt"));
        //
        User o = (User) ois.readObject();
        ois.close();
        System.out.println(o);
    }
}
